﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CARMSBusiness;
using CARMSData.CollectionClasses;
using CARMSData.EntityClasses;
using CARMSData.HelperClasses;


namespace CARMS.Report
{

    [Function("Report.TestReportOne")]
    public partial class TestReportOneView : PageBase
    {
        protected int CurrentReportHeaderID
        {
            get
            {
                return GetIntByParameter("ID");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                SetButtonEnabled();
                LoadDefault();
            }
               
        }
        #region button event
 
        #endregion

        private void LoadDefault()
        {
            var reportHeaderID = CurrentReportHeaderID;
            var collection = new ReportOneCollection();
            collection.GetMulti(ReportOneFields.ReportHeaderId == reportHeaderID);
            if(collection.Count>0)
            {
                lblContent.Text = collection[0].ReportOneName;
            }


        }

       protected void btnReturn_Click(object sender,EventArgs e)
       {
           RediretResolveUrl("~/report/myreporthistory.aspx");
       }
    }
}
